/**
* 
* ====================================================================
*
* @author apov <apov@ymail.com>
*/ 
#pragma once

#include <BaseDefine.h>
#include <queue>
#include <Thread.h>
#include <StringObj.h>

class WorkListener;
class CmdLine{
public:
	void wait_cmd();	
	void print( char *pFmt, ...  );
	void print_error( char* pFmt, ... );
	void print_prompt();
	void print_to_prompt( char* msg );

	CmdLine( char* title, WorkListener* worker );
	virtual ~CmdLine();

protected:

private:
	void make_prompt();	

	StringObj prompt_;
	StringObj buf_;	
	CLock lock_;

	WorkListener* worker_;
};
